package site.isscloud.project.service.impl;

import java.util.List;
import site.isscloud.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import site.isscloud.project.mapper.PjProjectMapper;
import site.isscloud.project.domain.PjProject;
import site.isscloud.project.service.IPjProjectService;

/**
 * 项目信息Service业务层处理
 * 
 * @author Junhuang
 * @date 2025-10-07
 */
@Service
public class PjProjectServiceImpl implements IPjProjectService 
{
    @Autowired
    private PjProjectMapper pjProjectMapper;

    /**
     * 查询项目信息
     * 
     * @param pjId 项目信息主键
     * @return 项目信息
     */
    @Override
    public PjProject selectPjProjectByPjId(Long pjId)
    {
        return pjProjectMapper.selectPjProjectByPjId(pjId);
    }

    /**
     * 查询项目信息列表
     * 
     * @param pjProject 项目信息
     * @return 项目信息
     */
    @Override
    public List<PjProject> selectPjProjectList(PjProject pjProject)
    {
        return pjProjectMapper.selectPjProjectList(pjProject);
    }

    /**
     * 新增项目信息
     * 
     * @param pjProject 项目信息
     * @return 结果
     */
    @Override
    public int insertPjProject(PjProject pjProject)
    {
        pjProject.setCreateTime(DateUtils.getNowDate());
        return pjProjectMapper.insertPjProject(pjProject);
    }

    /**
     * 修改项目信息
     * 
     * @param pjProject 项目信息
     * @return 结果
     */
    @Override
    public int updatePjProject(PjProject pjProject)
    {
        pjProject.setUpdateTime(DateUtils.getNowDate());
        return pjProjectMapper.updatePjProject(pjProject);
    }

    /**
     * 批量删除项目信息
     * 
     * @param pjIds 需要删除的项目信息主键
     * @return 结果
     */
    @Override
    public int deletePjProjectByPjIds(Long[] pjIds)
    {
        return pjProjectMapper.deletePjProjectByPjIds(pjIds);
    }

    /**
     * 删除项目信息信息
     * 
     * @param pjId 项目信息主键
     * @return 结果
     */
    @Override
    public int deletePjProjectByPjId(Long pjId)
    {
        return pjProjectMapper.deletePjProjectByPjId(pjId);
    }
}
